/**
 * "Visual Paradigm: DO NOT MODIFY THIS FILE!"
 * 
 * This is an automatic generated file. It will be regenerated every time 
 * you generate persistence class.
 * 
 * Modifying its content may cause the program not work, or your work may lost.
 */

/**
 * Licensee: Carla Painemilla
 * License Type: Evaluation
 */
package orm;

import java.io.Serializable;
/**
 * Tabla que define los sectores a los que pertenece una anotación
 */
public class Subsector implements Serializable {
	public Subsector() {
	}
	
	private java.util.Set this_getSet (int key) {
		if (key == orm.ORMConstants.KEY_SUBSECTOR_ANOTACION) {
			return ORM_anotacion;
		}
		
		return null;
	}
	
	private void this_setOwner(Object owner, int key) {
		if (key == orm.ORMConstants.KEY_SUBSECTOR_CURSOCURSO) {
			this.cursocurso = (orm.Curso) owner;
		}
	}
	
	org.orm.util.ORMAdapter _ormAdapter = new org.orm.util.AbstractORMAdapter() {
		public java.util.Set getSet(int key) {
			return this_getSet(key);
		}
		
		public void setOwner(Object owner, int key) {
			this_setOwner(owner, key);
		}
		
	};
	
	private int sub_id;
	
	private String sub_descrip;
	
	private orm.Curso cursocurso;
	
	private java.util.Set ORM_anotacion = new java.util.HashSet();
	
	/**
	 * Atributo que identifica el sector al que pertenece la anotación.
	 */
	private void setSub_id(int value) {
		this.sub_id = value;
	}
	
	/**
	 * Atributo que identifica el sector al que pertenece la anotación.
	 */
	public int getSub_id() {
		return sub_id;
	}
	
	public int getORMID() {
		return getSub_id();
	}
	
	/**
	 * Atributo que almacena la descripción de cada subsector.
	 */
	public void setSub_descrip(String value) {
		this.sub_descrip = value;
	}
	
	/**
	 * Atributo que almacena la descripción de cada subsector.
	 */
	public String getSub_descrip() {
		return sub_descrip;
	}
	
	public void setCursocurso(orm.Curso value) {
		if (cursocurso != null) {
			cursocurso.subsector.remove(this);
		}
		if (value != null) {
			value.subsector.add(this);
		}
	}
	
	public orm.Curso getCursocurso() {
		return cursocurso;
	}
	
	/**
	 * This method is for internal use only.
	 */
	public void setORM_Cursocurso(orm.Curso value) {
		this.cursocurso = value;
	}
	
	private orm.Curso getORM_Cursocurso() {
		return cursocurso;
	}
	
	private void setORM_Anotacion(java.util.Set value) {
		this.ORM_anotacion = value;
	}
	
	private java.util.Set getORM_Anotacion() {
		return ORM_anotacion;
	}
	
	public final orm.AnotacionSetCollection anotacion = new orm.AnotacionSetCollection(this, _ormAdapter, orm.ORMConstants.KEY_SUBSECTOR_ANOTACION, orm.ORMConstants.KEY_ANOTACION_SUBSECTORSUB, orm.ORMConstants.KEY_MUL_ONE_TO_MANY);
	
	public String toString() {
		return String.valueOf(getSub_id());
	}
	
}
